#ifndef COMMANDS_H
#define COMMANDS_H

#include <QUndoCommand>

#include "imageitem.h"

class MoveCommand : public QUndoCommand
{
public:
    enum { Id = 1234 };

    MoveCommand(ImageItem *imageItem, const QPointF &oldPos,
                QUndoCommand *parent = 0);

    void undo();
    void redo();
    int id() const { return Id; }

private:
    ImageItem *m_imageItem;
    QPointF m_oldPos;
    QPointF m_newPos;
};

class ImageCommand : public QUndoCommand
{
public:
    ImageCommand(ImageItem *imageItem, const QImage &newPixmap, QString operatorStr,
                 QUndoCommand *parent = 0);

    void undo();
    void redo();

private:
    ImageItem *m_imageItem;
    QString m_operatorStr;
    QImage m_oldPixmap;
    QImage m_newPixmap;
};

#endif // COMMANDS_H
